* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    padding: 20px;
    padding-top: 120px; /* 为固定的标题和按钮栏腾出空间 */
    min-width: 1200px; /* 设置最小宽度 */
    overflow-x: auto; /* 当宽度小于最小宽度时显示横向滚动条 */
}

/* 主内容区布局 */
.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    flex: 1; /* 让container自动填充剩余空间 */
    min-width: 0; /* 允许容器收缩 */
}

/* 固定标题和按钮栏 */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    z-index: 100;
}

.fixed-header-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

h1 {
    text-align: left;
    color: #333;
    margin: 0;
}

.buttons-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button, .upload-btn {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover, .upload-btn:hover {
    background-color: #45a049;
}

.upload-btn {
    display: inline-block;
}

.complete-btn {
    background-color: #2196F3;
    margin-left: auto;
}

.complete-btn:hover {
    background-color: #0b7dda;
}

#clear-all {
    background-color: #f44336;
}

#clear-all:hover {
    background-color: #d32f2f;
}

#clear-changes {
    background-color: #f4ae36;
}

#clear-changes:hover {
    background-color: rgb(225, 181, 71);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    min-width: 150px;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: relative;
}

th[contenteditable="true"]:hover {
    background-color: #e0e0e0;
}

td[contenteditable="true"] {
    min-height: 40px;
}

td[contenteditable="true"]:focus {
    outline: 2px solid #2196F3;
}

/* 改动标记样式 */
.changed {
    background-color: #ffc107; /* 橙色 */
}

/* 广告位样式 */
.sidebar-ad {
    width: 300px;
    background-color: #f3f3f3;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    height: calc(100vh - 140px); /* 减去顶部和底部padding */
}

/* 响应式样式 */
@media (max-width: 1500px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar-ad {
        width: 100%;
        height: 160px;
    }
}

/* 弹窗样式保持不变 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.small-modal {
    width: 400px;
    text-align: center;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
}

.json-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.json-box {
    flex: 1 1 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #f9f9f9;
}

.json-box h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.json-box pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #eee;
    padding: 10px;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.copy-btn {
    margin-top: 10px;
    background-color: #2196F3;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

#confirm-yes, #exit-leave {
    background-color: #f44336;
}

#confirm-yes:hover, #exit-leave:hover {
    background-color: #d32f2f;
}

/* 黏贴整列按钮样式 */
.paste-column-btn {
    padding: 3px 8px;
    background-color: #e8f5e9; /* 浅绿色背景 */
    color: #2e7d32; /* 绿色字体 */
    border: 1px solid #2e7d32; /* 绿色边框 */
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    vertical-align: middle;
}

.paste-column-btn:hover {
    background-color: #c8e6c9;
}

.copy-column-btn {
    padding: 3px 8px;
    background-color: #e3f2fd; /* 浅蓝色背景 */
    color: #1976d2; /* 蓝色字体 */
    border: 1px solid #1976d2; /* 蓝色边框 */
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    vertical-align: middle;
}

.copy-column-btn:hover {
    background-color: #bbdefb;
}

/* 序号列样式 */
th:first-child, td:first-child {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
}